﻿using EasyAdmin.Domain.Shared.Enums;
using EasyCore.Domain.Entities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyAdmin.Domain.Entities.Systems
{
    /// <summary>
    /// 菜单管理
    /// </summary>
    [SugarTable("sys_menu")]
    public class SysMenu : AuditedEntity
    {
        /// <summary>
        /// 菜单唯一标识
        /// </summary>
        [SugarColumn(IsPrimaryKey = true,IsIdentity = true,IsNullable = false,ColumnDescription = "菜单唯一标识")]
        public long Id { get; set; }

        /// <summary>
        /// 父菜单唯一标识
        /// </summary>
        [SugarColumn(IsNullable = false,ColumnDescription = "父菜单唯一标识")]
        public long ParentId { get; set; }

        /// <summary>
        /// 菜单名称
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "菜单名称",Length = 30)]
        public string Title { get; set; }

        /// <summary>
        /// 路由路径：主要用于VUE单页面应用【用于访问页面】
        ///</summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "路由路径", Length = 150)]
        public string RoutePath { get; set; }

        /// <summary>
        /// 组件路径：页面的实际路径
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "组件路径", Length = 150)]
        public string ComponentPath { get; set; }

        /// <summary>
        /// 菜单类项：目录、页面
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "菜单类项", ColumnDataType ="int")]
        public MenuType MenuType { get; set; }

        /// <summary>
        /// 菜单图标
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "菜单图标", Length = 20)]
        public string Icon { get; set; }

        /// <summary>
        /// 菜单是否显示
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "菜单是否显示")]
        public bool IsShow { get; set; }

        /// <summary>
        /// 是否是首页
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "是否是首页")]
        public bool IsHome { get; set;}

        /// <summary>
        /// 是否禁用
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "是否禁用")]
        public bool IsDisabled { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "排序")]
        public int OrderSort { get; set; }

        /// <summary>
        /// 当前页面的操作按钮列表
        /// </summary>
        [SugarColumn(IsJson = true,ColumnDataType ="NVARCHAR(200)", ColumnDescription = "操作按钮列表")]
        public List<long> Operations { get; set; }
    }
}
